@echo off
set CurrentPath=%~dp0
set P1Path=
:begin
for /f "tokens=1,* delims=\" %%i in ("%CurrentPath%") do (set content=%%i&&set CurrentPath=%%j)
if "%P1Path%%content%\" == "%~dp0" goto end
set P1Path=%P1Path%%content%\
goto begin
:end
For /f "tokens=1-3 delims=: skip=1 eol=#" %%i in ('findstr /n ".*" %P1Path%JM_config') do (echo %%i %%j
if %%i == 2 (
echo  Administrator@%%j:/C:/Users/Administrator/jmeterEnv/Matset_jmx/report %P1Path%Matset_jmx\
echo  Administrator@%%j:/C:/Users/Administrator/jmeterEnv/Matset_jmx/*.jtl %P1Path%Matset_jmx\
scp -P 22 -r Administrator@%%j:/C:/Users/Administrator/jmeterEnv/Matset_jmx/report %P1Path%Matset_jmx\ 
scp -P 22 Administrator@%%j:/C:/Users/Administrator/jmeterEnv/Matset_jmx/*.jtl %P1Path%Matset_jmx\
scp -P 22 Administrator@%%j:/C:/Users/Administrator/jmeterEnv/Matset_jmx/*.log %P1Path%Matset_jmx\
) ELSE (
scp -P 22 Administrator@%%j:/C:/Users/Administrator/jmeterEnv/jmeter/apache-jmeter-5.1.1/bin/errorReport*.log %P1Path%Matset_jmx\
     )
)




pause


rem 这里的报告回传包含： Master控制机HTML报告 + Slave错误日志记录

